﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>后台登陆中心</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</head>
<body>
    <label style="font-size:30px;position:absolute;top:20%;left:40%">请输入账号密码登陆</label>
    <div style="position:absolute;top:30%;left:40%;width:200px;height:100px;">
        <div class="form-group">
            <label for="LoginName">LoginName</label>
            <input type="text" class="form-control" id="LoginName" name="LoginName" placeholder="LoginName">
        </div>
        <div class="form-group">
            <label for="Password">Password</label>
            <input type="password" class="form-control" id="Password" name="Password" placeholder="Password">
        </div>
        <button type="button" class="btn btn-default" onclick="Check()">确定</button>
    </div>
    <script>
        function Check() {
            var LoginName = $("#LoginName").val();
            var Password = $("#Password").val();
            $.ajax({
                url: "/admin/backstage/logincheck",//链接视图
                data: { LoginName: LoginName, PWD: Password },//传递数据
                async: true,
                type: "POST",
                success: function (result) {
                    if (result.code == 1) {
                        location.href = "/admin/category/index";
                    } else {
                        alert("账号或密码出错");
                    }
                }
            });
        }
    </script>
</body>
</html>
